package com.blb.zycommunity.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blb.zycommunity.entity.SysArea;
import com.blb.zycommunity.entity.ZyCommunity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 * 小区  Mapper 接口
 * </p>
 *
 * @author chenheng
 * @since 2023-11-20
 */
@Mapper
public interface ZyCommunityMapper extends BaseMapper<ZyCommunity> {

    /**
     * 小区信息分页   还有模糊查询
     * @return
     */
    Page<ZyCommunity> selectCommunityPage(Page<ZyCommunity> page, String communityName, String communityCode,String communityId);

    List<SysArea> selectAreaByCode(String provenceCode,String cityCode,String townCode);

    ZyCommunity selectCommunityById(String communityId);

    @Select("select * from zy_community")
    List<ZyCommunity> selectAllCommunity();

    @Select("select community_name from zy_community where community_id=#{communityId}")
    String selectNameById(String communityId);
}
